package sctu.edu.java.year2016.team07.wenjia.day20160522.chapter4_2;

/**
 * Created by 001 on 2016/5/22.
 * 用for循环语句打印菱形
 */
public class dayinlingxing {
    public static void main(String[]args){
        int r=5;
        System.out.println("打印菱形是：\n");
        for(r=1;r<=5;r++){
         if(r==1||r==5){
             System.out.println("     *");
         }
            else if(r==2||r==4) {
                 System.out.println("  *     *");
             }
              else
                  System.out.println("*         *");
         }
    }
  }


